package com.seecen.controller;

import com.seecen.pojo.vo.PortalVo;
import com.seecen.service.TopicService;
import com.seecen.service.TypeService;
import com.seecen.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/topic")
@CrossOrigin
public class TopicController {
//帖子控制器
    @Autowired
    private TopicService topicService;

    @Autowired
    private TypeService typeService;


//    @PostMapping("findTopicPage")
//    public Result findTopicPage(@RequestBody PortalVo portalVo){
//       Result ret= topicService.findTopicPage(portalVo);
//       return ret;
//    }

    @PostMapping("showTopicDetail")
    public Result showTopicDetail(@RequestParam("topicId") Integer topicId){
        Result ret=topicService.showTopicDetail(topicId);
        return  ret;
    }

    @GetMapping("findAllTopic")
    public  Result findAllTopic(){
        Result ret=topicService.findAllTopic();
        return ret;
    }

    @GetMapping("findAllType")
    public  Result findAllType(){
        Result ret=typeService.findAllType();
        return ret;
    }

}
